home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / mqwkid100.lha / MQwkID / Install_MQwkID < prev    next >
Text File  |  1994-12-25  |  7KB  |  219 lines

  1. ; $VER: MQwkID Install 1.00 (12.25.94) by Jason Gouger
  2.  
  3. (set source-dir (pathonly (expandpath @icon)))
  4.  
  5. (procedure install-exit
  6.     (complete 100)
  7.     (transcript "\nPlease support the ShareWare concept.\n")
  8.     (set @default-dest MQwkID-Dir)
  9.     (exit @app-name" is ShareWare\n\nPlease support the ShareWare concept!\n\n"
  10.             "Registrations have been VERY slim over the past few months, "
  11.             "and I know more than 5 of you are using MQwkID.  Please, do NOT make"
  12.             " me cripple this door in order for Sysop's/User's to register MQwkID!")
  13. )
  14.  
  15. (procedure make-directory
  16.     (if(= 0 install-icons) (makedir(make-dir)))
  17.     (if(= 1 install-icons) (makedir(make-dir) (infos)))
  18. )
  19.  
  20. (procedure select-destination-directory
  21.     (set destdir
  22.         (askdir
  23.             (prompt "In which drawer should "@app-name" be installed?") 
  24.             (help "You should install "@app-name" in the Doors Path defined in the MEBBSNet configuration.")
  25.             (default "DOORS:")
  26.            (newpath)
  27.         )
  28.     )
  29.     (set MQwkID-Dir(tackon destdir "MQwkID"))
  30.     (set Text-Dir(tackon MQwkID-dir "Text"))
  31.     (set Config-Dir(tackon MQwkID-dir "Config"))
  32. )
  33.  
  34. (procedure copy-icons
  35.     (if(= 1 install-icons) (
  36.         (transcript "\nCopying info files...\n")
  37.         (copyfiles
  38.             (source source-dir) (dest MQwkID-Dir)
  39.             (choices "Text.info" "Config.info")
  40.             (files)
  41.         )
  42.     ))
  43. )
  44.  
  45. (procedure copy-mqwkid-text
  46.     (transcript "\nCopying text files...\n")
  47.     (copyfiles
  48.         (source (tackon source-dir "Text")) (dest Text-Dir)
  49.         (pattern "#?")
  50.         (files)
  51.         (if(= 1 install-icons) (infos))
  52.     )
  53. )
  54.  
  55. (procedure copy-mqwkid-prg
  56.     (copyfiles
  57.         (source source-dir) (dest MQwkID-Dir)
  58.         (pattern "MQwkID")
  59.         (files)
  60.         (if(= 1 install-icons) (infos))
  61.     )
  62. )
  63.  
  64. (procedure copy-mqwkid-intro
  65.     (transcript "\nCopying introduction files...\n")
  66.     (copyfiles
  67.         (source source-dir) (dest MQwkID-Dir)
  68.         (pattern "MQwkID.txt")
  69.         (files)
  70.         (if(= 1 install-icons) (infos))
  71.     )
  72. )
  73.  
  74. (procedure copy-mqwkid-cfg
  75.     (transcript "\nCopying configuration file...\n")
  76.     (copyfiles
  77.         (source (tackon source-dir "Config")) (dest Config-Dir)
  78.         (pattern "MQwkID.CFG")
  79.         (files)
  80.         (if(= 1 install-icons) (infos))
  81.     )
  82. )
  83.  
  84. (procedure copy-mqwkid-strings
  85.     (transcript "\nCopying strings file...\n")
  86.     (copyfiles
  87.         (source (tackon source-dir "Config")) (dest Config-Dir)
  88.         (pattern "MQwkID.Str")
  89.         (files)
  90.         (if(= 1 install-icons) (infos))
  91.     )
  92. )
  93.  
  94. (procedure copy-mqwkid-doc
  95.     (transcript "\nCopying documentation...\n")
  96.     (copyfiles
  97.         (source source-dir) (dest MQwkID-Dir)
  98.         (pattern "MQwkID.guide")
  99.         (files)
  100.         (if(= 1 install-icons) (infos))
  101.     )
  102.     (if ((exists "SYS:Utilities/MultiView")) 
  103.         (tooltype(
  104.             (dest (tackon MQwkID-Dir "MQwkID.guide"))
  105.             (setdefaulttool "SYS:Utilities/MultiView")
  106.         ))
  107.         (tooltype(
  108.             (dest (tackon MQwkID-Dir "MQwkID.guide"))
  109.             (setdefaulttool "SYS:Utilities/AmigaGuide")
  110.         ))
  111.     )
  112. )
  113.  
  114. (procedure add-mqwkid-menu
  115.     (if (askbool
  116.         (prompt "Would you like to add the MQwkID program to a menu?")
  117.         (help "Selecting YES to thie option will allow you to add MQwkID to "
  118.                     "a menu.  If you choose no, you must add the Door to a menu manually."))
  119.         ((set menu-file (askfile
  120.             (prompt "Select the Menu File you would like the MQwkID added to.")
  121.             (help "Select a valid NON COMPILED MENU FILE (#?.Menu) for the menu option "
  122.                     "to be appended.")
  123.             (default "MEBBSNet:Menus/MessageMenu.Menu"))
  124.         )
  125.  
  126.         (if (= 1 (exists menu-file)) (
  127.             (set menuop "xx")
  128.             (while (< 1 (strlen menuop))
  129.             (set menuop
  130.                 (askstring
  131.                 (prompt "Select a valid MEBBSNet menu character that is NOT currently in "
  132.                           "the menu file:\n'"menu-file"':")
  133.                (default "")
  134.                (help "Choose ONE character to activate the MQwkID door.  This character "
  135.                         "will be added as a menu option to access the door.\n\nNote: This "
  136.                         "character MUST be a VALID menu character.")
  137.             ))
  138.             (if (= 1 (strlen menuop))
  139.                 ((set menu-text ("\nOption '%s':\n   Function MultiRunDoor %s\n   end" menuop (tackon MQwkID-Dir "MQwkID")))
  140.                 (set dash-txt "--------------------------------------------------")
  141.                 (if (askbool
  142.                     (prompt "Are you sure you would like to append the the following menu option "
  143.                               "to the Menu File '"menu-file"'?\n\n\n"dash-txt menu-text "\n" dash-txt"\n\n")
  144.                     (help "Selecting YES to this option will append:\n\n"dash-txt menu-text "\n" dash-txt"\n\n"
  145.                             "to the '"menu-file"' file.\n\n"
  146.                             "Warning: If you select an incorrect menu/option you may corrupt your "
  147.                             "menu configuration file!"))
  148.                     ((textfile (dest menu-file) (include menu-file) (append (cat menu-text "\n")))
  149.                         (set @execute-dir (pathonly menu-file))
  150.                         (run (cat "MEBBSNet:c/MenuCompiler " (fileonly menu-file))))
  151.                 )
  152.             ))))
  153.         )
  154.     ))
  155. )
  156.  
  157. (procedure ask-install-icons
  158.     (set install-icons 0)
  159.     (if (askbool
  160.         (prompt "Would you like the icons installed for MQwkID?")
  161.         (help "Selecting YES to this option will create the respective icons so that "
  162.                 "the directory and documentation may be accessed through WorkBench."))
  163.         ((set install-icons 1))
  164.     )
  165. )
  166.  
  167. (procedure mqwkid-update-install
  168.     (if(askbool
  169.         (prompt "You currently have "@app-name" installed, would you like to "
  170.                   "Update "@app-name"?")
  171.         (help "If you select YES to update, only the files that have changed since the "
  172.                 "LAST version will be copied, otherwise the complete package will be "
  173.                 "installed.\n\nNote: Old Files WILL be OVERWRITTEN, "
  174.                 "so make sure you make backups of older files if desired."))
  175.         (if(askbool
  176.             (prompt "Updating from VERSION 0.15 to 1.00\n\nWARNING the following "
  177.                       "files will be OVERWRITTEN:\n\n MQwkID\nMQwkID.txt\nNews.txt\n"
  178.                       "MQwkID.guide\n\nAre you sure you would like to continue?")
  179.             (help "If you select YES to this option, older files will be OVERWRITTEN, "
  180.                     "and the new version will be installed."))
  181.             ((transcript "\nUpdate Installation...\n")
  182.             (complete 30) (ask-install-icons)
  183.             (complete 40) (copy-icons)
  184.             (complete 50) (copy-mqwkid-prg)
  185.             (complete 60) (copy-mqwkid-intro)
  186.             (complete 75) (copyfiles
  187.                 (source (tackon source-dir "Text")) (dest Text-Dir)
  188.                 (pattern "News.txt")
  189.                 (files)
  190.                 (if(= 1 install-icons) (infos))
  191.             )
  192.             (complete 90) (copy-mqwkid-doc)
  193.             (install-exit)) 
  194.         (install-exit)))
  195.     ((message "Renaming '"MQwkID-Dir"' to '"MQwkID-Dir"-Old'.")
  196.      (rename MQwkID-Dir (cat MQwkID-Dir "-Old")))
  197. )
  198.  
  199. (procedure mqwkid-full-install
  200.     (transcript "\nFull Installation...\n")
  201.     (complete 15) (ask-install-icons)
  202.     (complete 20) (set make-dir MQwkID-Dir) (make-directory)
  203.     (complete 25) (makedir(tackon MQwkID-Dir "QwkWaiting"))
  204.     (complete 30) (copy-icons)
  205.     (complete 35) (copy-mqwkid-prg)
  206.     (complete 40) (copy-mqwkid-intro)
  207.     (complete 50) (copy-mqwkid-cfg)
  208.     (complete 60) (copy-mqwkid-strings)
  209.     (complete 70) (copy-mqwkid-text)
  210.     (complete 80) (copy-mqwkid-doc)
  211.     (complete 90) (add-mqwkid-menu)
  212.     (install-exit)
  213. )
  214.  
  215. (complete 00) (transcript "Installation script for " @app-name ".")
  216. (complete 10) (select-destination-directory)
  217. (if(exists MQwkId-Dir (noreq)) (mqwkid-update-install))
  218. (mqwkid-full-install)
  219.